<#include "/include/macros.ftl">
<@header></@header>

<div class="clearfix"></div>
<div class="row">
    <div class="col-md-12 col-sm-12 col-xs-12">
        <ol class="breadcrumb">
            <li><a href="/">首页</a></li>
            <li class="active">康复管理</li>
        </ol>
        <#include "/common/toolbar.ftl" />
    </div>
</div>

 <#include "/child/evalVersion.ftl" />
 
<!--弹框评估框-->
<div class="modal fade bs-example-modal-sm" id="selectEvaluationContent" tabindex="-1" role="dialog" aria-labelledby="selectEvaluationContentLabel">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="selectEvaluationContentLabel">开始评估</h4>
            </div>
            <div class="modal-body">
                <form id="boxEvalForm">
                    <div class="zTreeDemoBackground left">
                        <ul id="treeEvaluation" class="ztree"></ul>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" id="btnRefreshSmall" class="btn btn-default" data-glyphicon="glyphicon-refresh">刷新</button>
	            <button type="button" id="btnSaveSmall" class="btn btn-default btn-primary" data-glyphicon="glyphicon-ok">保存</button>
                <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-close"> 关闭</i></button>
            </div>
        </div>
    </div>
</div>

<!--上传视频弹框-->
<div class="modal fade" id="chooseFile" tabindex="-1" role="dialog" aria-labelledby="addroleLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="addroleLabel">选择视频</h4>
            </div>
            <div class="modal-body">
                            <button type="button" class="btn btn-success" id="file-btn">选择视频</button>
                             <!-- <input id="cover-vedio-file" type="file" name="file" style="display: none">
                              <input id="cover-vedio-input" type="hidden" name="coverImage"> -->
                              <!-- <div class="preview" class="fa-2x"> -->
                              <div>
                                 <!-- <video id="videoPlay1" width="262" height="195" src="video/audio.mp4" poster="img/video.jpg" loop="loop" x-webkit-airplay="true" webkit-playsinline="true">
							                        您的浏览器暂不支持播放该视频，请升级至最新版浏览器。
							     </video> -->
							     
							         <input id="input-id" name="file" multiple type="file" data-show-caption="true">
                              </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-close"> 关闭</i></button>
                <button type="button" class="btn btn-success" data-dismiss="modal"><i class="fa fa-hand-o-up"> 确定</i></button>
            </div>
        </div>
    </div>
</div>
<!--上传视频弹框-->

<!--设定孩子类型弹框-->
<div class="modal fade" id="childTypeModalId" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="addroleLabel">选择孩子类型</h4>
            </div>
            <div class="modal-body">
            	  <form id="childEvalForm" class="form-horizontal form-label-left" novalidate>
	            		 <input type="hidden" name="id" id="whoschildid">
	            		 <label class="control-label col-md-3 col-sm-3 col-xs-12" for="intEvaluation">孩子类型:<span class="required">*</span></label>
	                     <div class="col-md-6 col-sm-6 col-xs-12">
	                            <select name="intEvaluation" id="intEvaluation" class="form-control col-md-7 col-xs-12" required="required">
	                            	<option value="">请选择</option>
	                                		<@yyTag method="dicts" dictType="CHILDTYPE">
			                                    <#if dicts?? && dicts?size gt 0>
			                                        <#list dicts as dict>
			                                            <option value="${dict.dictTypeId}">${dict.dictTypeId}-${dict.dictTypeName}</option>
			                                        </#list>
			                                    <#else>
			                                        <option value="">无</option>
			                                    </#if>
			                                </@yyTag>
	                            </select>
	                    </div>
                    </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-close"> 关闭</i></button>
                <button type="button" class="btn btn-success btn-eval" data-dismiss="modal"><i class="fa fa-hand-o-up"> 确定</i></button>
            </div>
        </div>
    </div>
</div>
<!--设定孩子类型弹框-->

 <#include "/child/addOrUpdateChild.ftl" />
 
<@footer>
    <script type="text/javascript">

    
    /**
     * 操作按钮
     * @param code
     * @param row
     * @param index
     * @returns {string}
     */
    function operateFormatter(code, row, index) {
        var currentUserId = '${user.id}';
        var trChildId = row.id;
        var operateBtn = [
            '<@shiro.hasPermission name="child:edit"><a class="btn btn-xs btn-primary btn-update" data-id="' + trChildId + '"><i class="fa fa-edit"></i>编辑</a></@shiro.hasPermission>',
            '<@shiro.hasPermission name="child:eval"><a class="btn btn-xs btn-warning btn-evalcontext" data-id="' +trChildId + '"><i class="fa fa-user-md"></i>评估</a></@shiro.hasPermission>',
        ];
            operateBtn.push('<@shiro.hasPermission name="child:delete"><a class="btn btn-xs btn-danger btn-remove" data-id="' + trChildId + '"><i class="fa fa-trash-o"></i>删除</a></@shiro.hasPermission>');
            operateBtn.push('<@shiro.hasPermission name="child:lookeval"><a class="btn btn-xs btn-info btn-vieweval" data-id="' + trChildId + '"><i class="fa fa-address-card"></i>查估</a></@shiro.hasPermission>');
            operateBtn.push('<@shiro.hasPermission name="child:view"><a class="btn btn-xs btn-info btn-view" data-id="' + trChildId + '"><i class="fa fa-tripadvisor"></i>查看</a></@shiro.hasPermission>');
        return operateBtn.join('');
    }
     
     
     function operateVersion(code, row, index) {
     	var trChildId = row.childId;
         var operateBtn = [
             '<@shiro.hasPermission name="child:email"><a class="btn btn-xs btn-primary btn-sendmail" data-id="' + trChildId + '"><i class="fa fa-envelope-o"></i>发送邮件</a></@shiro.hasPermission>',
             '<@shiro.hasPermission name="child:upload"><a class="btn btn-xs btn-success btn-uploadfile" data-id="' + trChildId + '"><i class="fa  fa-arrows-alt"></i>上传视频</a></@shiro.hasPermission>',
         ];
         return operateBtn.join('');
     }
	</script>
    
    
    <script src="/assets/js/yyl.child.js"></script>
    
</@footer>